<template>
  <div class="yingmoo-store">
    <ul class="nav">
      <li>检错的媒体</li>
    </ul>
    <div class="error">
      <table>
        <tr>
          <td>序号</td>
          <td>媒体编号</td>
          <td>媒体名称</td>
          <td>错误描述</td>
          <td>检错时间</td>
          <td>处理状态</td>
          <td>处理时间</td>
          <td>处理内容</td>
        </tr>
        <tr v-for="(error,index) in errorList">
        	<td>{{index+1}}</td>
          <td v-if="error.mediaCode!=null">{{error.mediaCode}}</td>
          <td v-if="error.mediaId==null">{{error.mediaId}}</td>
          <td>{{error.mediaName}}</td>
          <td>{{error.errorInfo}}</td>
          <td>{{error.createTime}}</td>
          <td v-if="error.struts == 0">未处理</td>
          <td v-if="error.struts == 1">已处理</td>
          <td>{{error.endTime}}</td>
          <td>{{error.backInfo}}</td>
        </tr>
      </table>
    </div>
    
  </div>
</template>

<script>
  export default {
    name: "yingmoo-store",
    data() {
      return {
      	requestAddr:this.GLOBAL.addr,
      	user:null,
      	errorList:null,
        table:[{
          serial: '1',
          num: 'YHSC969620',
          form: '陕西体育场运动商城LED显示屏',
          dismantle: '已拆除',
          time: '2017-11-30',
          over: '已处理',
          hour: '2017-12-01',
          delete: '已删除'
        }]
      }
    },
    mounted(){
    	this.getMyErrorList();
    },
    methods:{
    	getMyErrorList(){
    		this.user = JSON.parse(localStorage.getItem("user"))
    		this.$http.post(this.requestAddr+"/GetJson/errorList",{"userId":this.user.autoId},{emulateJSON:true}).then(
    			(res)=>{
    				this.errorList = res.data.errorList;
    				if(this.errorList.length==0||this.errorList==null){
    					window.location.href = "../#/ymMembererror"
    				}
    			}
    		)
    	}
    }
  }

</script>

<style scoped lang="less">
  .yingmoo-store {
    width: 100%;
    .nav {
      width: 1200px;
      height: 46px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      background-color: #f2f2f2;
      margin-top: 20px;
      li {
        list-style: none;
        width: 90px;
        height: 30px;
        margin: 0 20px;
        line-height: 30px;
        text-align: center;
        font-size: 16px;
        cursor: pointer;
        background-color: #036eb7;
        color: white;
      }
    }
    .error {
      width: 1200px;
      background-color: white;
      margin: 0 auto;
      padding-top: 14px;
      padding-bottom: 60px;
      table {
        width: 1180px;
        margin: 0 auto;
        tr {
          height: 50px;
          text-align: center;
          line-height: 50px;
          border: 1px solid #f4f4f4;
          color: #333333;
          font-size: 14px;
          &:nth-child(1) {
            background-color: #f4f4f4;
          }
        }
      }
    }
  }

</style>
